#include <allegro.h>
#include "carte_final.h"


// fonction loading images

void load (BITMAP **plaque_v , BITMAP **gris ,BITMAP **gun ,BITMAP **knife ,BITMAP **watch ,BITMAP **plaque_vides, BITMAP **curseur,BITMAP **result,BITMAP **buffer )

{
*curseur = load_bitmap("mouse.bmp", NULL) ;
*gris = load_bitmap("gris.bmp", NULL) ;
*gun = load_bitmap("gun.bmp", NULL) ;
*knife = load_bitmap("knife.bmp", NULL) ;
*watch = load_bitmap("watch.bmp", NULL) ;
*plaque_vides= load_bitmap("plaques_vides.bmp", NULL) ;
*result = load_bitmap("result.bmp", NULL) ;


 if(!(*plaque_vides)|| /*!(*gris) || !(*curseur) || !(*gun) || !(*knife) || !(*watch)*/) 
  {
    set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
    allegro_message("Erreur ! Impossible de lire le fichier image !");
    
  }

    *buffer = create_bitmap(SCREEN_W, SCREEN_H) ;
    text_mode(-1) ;

   }


//fonction destroy

void destroy(BITMAP **gris,BITMAP **gun ,BITMAP **knife ,BITMAP **watch ,BITMAP **plaque_vides,BITMAP **curseur,BITMAP **result,BITMAP **buffer )

{

destroy_bitmap(*gris) ;
destroy_bitmap(*gun) ;
destroy_bitmap(*knife) ;
destroy_bitmap(*watch) ;
destroy_bitmap(*plaque_vides) ;
destroy_bitmap(*buffer);
destroy_bitmap(*curseur);
destroy_bitmap(*result);

}











